export const baseMixins = {
  data() {
    return {
      queryUrl: []
    }
  },
  computed: {

  },
  methods: {
    callFunction(fncname, fncInfo) {
      this[fncname](fncInfo);
    },
    canModify(functionList){
        return functionList.findIndex(item => item.sysFnc.isEdit) >= 0
    },
    hasFunction(list, name){
      return list.findIndex(item => item.sysFnc.funcName === name) >= 0
    },
    addOperation() {
      this.tableConfig.columnConfig.push(this.canModify && {
        type: "operation",
        align: "center",
        width: "80px",
        label: "操作"
      })
    },

    forEachQuery() {
      this.functionList.forEach(item => {
        if (item.sysFnc.isQuery && item.sysFnc.isUse) {
          this[item.sysFnc.funcName](item.apiUrl);
          this.queryUrl.push(item.apiUrl)
        }
      })
    },

  }

}